package org.util;

import java.util.Random;

import javax.microedition.lcdui.Graphics;

public class Util {
	public static final Random r = new Random();
	
	public static int getRandomColor(){
		int red = (r.nextInt(255) + 50) % 255;
		int green = (r.nextInt(255) + 50) % 255;
		int blue = (r.nextInt(255) + 50) % 255;
		
		return (red << 16) | (green << 8) | blue;
	}
	
	public final static void fillRect(Graphics g , int x ,int y ,int width , int height){
		g.fillRect(x , y , width ,height);
	}
	
	public final static void drawRect(Graphics g , int x ,int y ,int width , int height){
		g.drawRect(x , y , width ,height);
	}
	
	public final static void drawString(Graphics g , String s , int x ,int y , int anchor){
		g.drawString(s, x, y, anchor);
	}
	
	public final static void fillTriangle(Graphics g , int x1 , int y1 , int x2 , int y2 , int x3 , int y3){
		g.fillTriangle(x1, y1, x2, y2, x3, y3);
	}
	
	public final static void fillPolygon(Graphics g ,int[] ps){
		throw new UnsupportedOperationException("fillPolygon :(");
	}
	
	public final static void gc(){
		System.gc();
	}
}
